﻿using System.Windows.Controls;
using System.Windows.Data;
using StockholmsStad.Windows.UI.Infrastructure;
using System.Windows;

namespace StockholmsStad.Windows.UI.Controls
{
    /// <summary>
    /// Interaction logic for ComboBoxControl.xaml
    /// </summary>
    public partial class ComboBoxControl
    {
       // public bool IsSynchronizedWithCurrentItem { get; set; }

        public ComboBoxControl()
        {
            InitializeComponent();
        }

        private void SetupBindings()
        {
            var labelContentBinding = new Binding("Label") {Source = this};
            label.SetBinding(ContentProperty, labelContentBinding);

            var tbTextBinding = new Binding("Text") {Source = this};
            textBox.SetBinding(TextBox.TextProperty, tbTextBinding);
        }

        public static DependencyProperty LabelProperty =
            DependencyProperty.Register("Label", typeof(string), typeof(NameValueControl));

        public static DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(string), typeof(NameValueControl));

        public string Label
        {
            get { return (string)GetValue(LabelProperty); }
            set { SetValue(LabelProperty, value); }
        }

        public string Text
        {
            get { return (string)GetValue(TextProperty); }
            set { SetValue(TextProperty, value); }
        }

        public new string ToolTip { get; set; }
        private void OnInitialize(object sender, System.EventArgs e)
        {
            gridLabelColumn.Width = new GridLength(Position.ColumnLabelWidth);
        }

        private void OnLoaded(object sender, RoutedEventArgs e)
        {

        }

    }
}
